package cn.edu.sjtu.se.dslab.project;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.log4j.Logger;

import cn.edu.sjtu.se.dslab.component.method.MethodComponent;

@Entity
@Table(name = "project_method")
public class ProjectMethod implements Serializable{
	private static final long serialVersionUID = 3182384248407823540L;

	private static final Logger logger = Logger.getLogger(ProjectMethod.class);
	
	private long id;
	private MethodComponent methodComponent;
	private Project project;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	
	@ManyToOne(cascade = { CascadeType.REFRESH})
	@JoinColumn(name = "methodComponent_id")
	public MethodComponent getMethodComponent() {
		return methodComponent;
	}
	public void setMethodComponent(MethodComponent methodComponent) {
		this.methodComponent = methodComponent;
	}
	
	@ManyToOne(cascade = { CascadeType.REFRESH})
	@JoinColumn(name = "project_id")
	public Project getProject() {
		return project;
	}
	public void setProject(Project project) {
		this.project = project;
	}
	
	
	
}
